<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta charset="UTF-8">
		<title>登录</title>
		<link rel="stylesheet" type="text/css" href="<%=basePath%>frontPage/css/public.css"/>
		<link rel="stylesheet" type="text/css" href="<%=basePath%>frontPage/css/login.css"/>
		<script type="text/javascript" src="<%=basePath%>frontPage/js/jquery-1.12.4.min.js"></script>
		<script type="text/javascript">
			function login(){
				$.ajax({
					url:"<%=basePath%>front/login",
					type:"post",
					dataType:"json",
					data:$("#loginId").serialize(),
					success:function(data){						
						window.location.href="<%=basePath%>front/toIndex?userId="+data.id;
					},
					error:function(){
						
					}
				})
			}
		</script>
	</head>
	<body>
		<!-------------------login-------------------------->
		<div class="login">
			<form action="" method="post" name="loginId" id="loginId">
				<h1><a href="index.html"><img src="<%=basePath%>frontPage/img/logo.png"></a></h1>
				<p></p>
				<h1>lining登录</h1><br>
				<font color="red" style="font-size: 20px;">${requestScope.error}</font><br>
				<div class="msg-warn hide"><b></b>公共场所不建议自动登录，以防账号丢失</div>
				<p><input type="text" name="name"  placeholder="昵称/邮箱/手机号"></p>
				<p><input type="text" name="loginPassword"  placeholder="密码"></p>
				<p><input type="button" name="" onclick="login()" value="登  录"></p>
				<p class="txt"><a class="" href="reg.jsp">免费注册</a><a href="forget.jsp">忘记密码？</a></p>
			</form>
		</div>
		
	</body>
</html>